package com.motorola.accessories;

public class MotWhisperAccessoryGenericAccessory {

    ////// IDS for Generic Desk

    public static int PHONE_POWERED = 18;     // Indicates the accessory needs to be powered by the phone to operate
    public static int USB_HOST      = 17;     // Indicates the accessory is a USB Host or a pass-through USB connection
    public static int USB_CLIENT    = 16;     // Indicates the accessory is a USB Client which requires the phone to switch to Host mode (without providing 5v on Vbus)
    public static int UART          = 15;     // The accessory requires the data interface to be configured in UART mode
    public static int SPEAKER_PHONE = 14;     // The Accessory supports the analog speakerphone mode
    public static int SPEAKER       = 13;     // Stereo Analog Output
    public static int DIGITAL_AUDIO_OUT = 12; // The accessory supports Digital Audio over USB
    public static int USB_AV_IN     = 11;     // The accessory supports an Audio & Video stream to the phone over USB
    public static int VIDEO_OUT     = 10;     // The accessory supports an Analog Video interface
    public static int HDMI          = 9;      // The accessory supports HD Video & Audio from the Smartphone (ie HDMI)
    public static int HID           = 8;      // The accessory supports Human Interaction Device capabilities
    public static int MASS_STORAGE  = 7;      // The accessory supports Mass Storage capabilities
    public static int MTP           = 6;      // The accessory supports Multimedia content synchronization
    public static int PRINTER       = 5;      // The accessory has printing capabilities
    public static int CALL_CONTROL  = 4;      // The accessory supports a call control interface over USB

    private MotWhisperAccessoryGenericAccessory() {  }  // class cannot be instantiated

    public static int isFeatureEnabled(int featureID, String accessory_id) {
        if ( MotWhisperAccessoryAdapter.getClassType(accessory_id) == MotWhisperAccessoryAdapter.CLASS_TYPE_GENERIC_ACCESSORY ) {
            return ( (MotWhisperAccessoryAdapter.getSemuID(accessory_id)>>featureID) & 0x01  );
        }
        return 0;
    }
}